#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QCamera>
#include <QTimer>
#include <QCameraImageCapture>
#include "QZXing.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private slots:
    void on_encodeButton_clicked();
    void on_decodeButton_clicked();
    void captureImage();
    void updateImage(int, const QImage&);

private:
    Ui::Widget *ui;
    QCamera* cam;
    QTimer* timer;
    QCameraImageCapture* capture;
    QZXing decoder;
};
#endif // WIDGET_H
